<?php
include("../include/config.inc.php");
include("userlogincheck.php");

$consql.="and userid='$userid' ORDER BY id DESC";
$sql = "select count(*) as count from ".tableprefix."order where 1=1 ".$consql;
$row=$db->fetch_array($db->query($sql));
$count=$row["count"];
$page=new ShowPage;
$page->PageSize=20;
$page->Total=$count;
$page->LinkAry = array("cid"=>$cid);
$sql="select * from ".tableprefix."order where 1=1 ".$consql." limit ".$page->OffSet();
$result=$db->query($sql);
$showpage= $page->ShowLink();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>收支明细 - 订戏会</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=9,Chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="../css/public.css">
<link rel="stylesheet" type="text/css" href="../css/user.css">
</head>
<body>
<div class="cashlist">
<?php     
if($count>0){
?>
	<ul>
<?php
while($row = $db->fetch_array($result)){
$paystate=$row["paystate"];
if($paystate==0){
$temp_paystatus="待支付";
}else{
$temp_paystatus="支付成功";
}
$goods_id=$row["goods_id"];
$goods_name=GetValueByKey(tableprefix."goods","goods_id",$goods_id,"goods_name");
?>
		<?php if($row["ordername"]=='入驻保证金'){?>
		<a href="bond.php">
		<li>
			<h1><tt>入驻保证金</tt><i>+<?php echo $row["amount"];?></i></h1>
			<span><em><?php echo date('Y-m-d',strtotime($row["createtime"]));?></em><p><?php echo $temp_paystatus;?></p></span>
		</li>
		</a>
		<?php }else{?>
		<a href="orderdetails.php?orderNo=<?php echo $row["orderNo"];?>">
		<li>
			<h1><tt>订金-<?php echo $goods_name;?></tt><i>+<?php echo $row["amount"];?></i></h1>
			<span><em><?php echo date('Y-m-d',strtotime($row["createtime"]));?></em><p><?php echo $temp_paystatus;?></p></span>
		</li>
		</a>
		<?php }?>
		
<?php
}
?>
	</ul>
	<div class="pages" style="margin-bottom:50px"><?php echo $showpage;?></div>
<?php
}else{
echo "<div style='padding:50px 0px;text-align:center;color:#990000;font-size:12px;'>没有找到合乎条件的记录</div>";
}
?>
</div>
<div class="paybtn"><a href="mywallet.php"><div class="paybox">返回</div></a></div>
</body>
</html>
<?php
$db->free_result($result);
$db->close();
exit;
?>